//
//  LMBaseRequest.swift
//  Pods
//
//  Created by zhuo on 2018/7/24.
//

import UIKit
import Moya

public protocol LMBaseRequest: TargetType {
    /*
     是否需要token
     */
    var needToken: Bool {get}
    var parser: LMBaseParser? { get }
    
}

/*
 baseURL自己实现extern达到配置的目的
 */
public extension LMBaseRequest {
    
    var needToken: Bool {return true}
    var parser: LMBaseParser? { return LMBaseParser() }
    
    var method: Moya.Method { return .get }
    
    /// Provides stub data for use in testing.
    var sampleData: Data { return Data(base64Encoded: "")! }
    
    /// The type of HTTP task to be performed.
    var task: Task { return .requestPlain }
    
    /// The type of validation to perform on the request. Default is `.none`.
    
    /// The headers to be used in the request.
    var headers: [String: String]? { return nil }
}
